<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<c:set value="${requestScope.response.data.one }" var="pojo"/>
<c:set value="${requestScope.roleResponse.data.list }" var="roleList" />
<jsp:useBean class="com.wang.users.pojo.AUsers" id="adminsPojo"/>
<!DOCTYPE HTML>
<html>
<head>
	<%@ include file="/common/include/title_back.jsp"%>
	<title>用户更新 - 用户中心</title>
</head>
<body>
<article class="page-container">
	<form class="form form-horizontal" id="formSubmit" action="${rootPath }/back/QuesBackServlet?method=quesDescUpdateSubmit">
		<input type="hidden" name="id" value="${pojo.id}">
		<input type="hidden" name="operType" value="${param.operType}">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span
					class="c-red">*</span>名称：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${pojo.name}" placeholder="请输入名称"
					   id="name" name="name">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">发布时间：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<c:if test="${pojo.pubTime != null && pojo.pubTime != ''}">
					<c:set value="${pojo.pubTime}" var="sys_now_str"/>
				</c:if>
				<input type="text" readonly="readonly" value="${sys_now_str }"
					   onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
					   id="pubTimeStr" name="pubTimeStr" class="input-text Wdate">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">状态：</label>
			<div class="formControls col-xs-8 col-sm-9 skin-minimal">
				<c:forEach items="${adminsPojo.enumsMap }" var="me" varStatus="stat">
					<c:if test="${fn:startsWith(me.key,'STATUS')}">
						<!-- 拆分,按照-拆分,取最后一个 -->
						<c:set value="${fn:split(me.key, '-')}" var="keys"/>
						<div class="radio-box">
							<label for="${me.key }${me.value}">
								<input type="radio" id="${me.key }${me.value}" name="status" value="${keys[1] }" ${pojo.status == keys[1] ? 'checked' : '' }>
								&nbsp;${me.value }
							</label>
						</div>
					</c:if>
				</c:forEach>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">内容：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<script name="content" id="editor" type="text/plain"
						style="width: 100%; height: 200px;">${pojo.content}</script>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button
						class="btn btn-primary radius" type="submit">
					<i class="Hui-iconfont">&#xe632;</i> 提交
				</button>
			</div>
		</div>
	</form>
</article>
<%@ include file="/common/include/footer_back.jsp" %>
<script type="text/javascript" >
	$(function(){
		$('.skin-minimal input').iCheck({
			checkboxClass: 'icheckbox-blue',
			radioClass: 'iradio-blue',
			increaseArea: '20%'
		});

		//表单验证
		$("#formSubmit").validate({
			rules:{
				email : {
					required : true,
					email:true,
				},
				phone:{
					required:true,
					isPhone:true,
				},
				qq:{
					required:true,
					isQq : true,
				},
				password:{
					required:true,
				},
				confirmPassword:{
					required:true,
					equalTo: "#password",
				},
			},
			onkeyup:false,
			focusCleanup:true,
			success:"valid",
			submitHandler:function(form){
				$(form).ajaxSubmit({
					type: 'post',
					success: function(data){
						/* 弹出框 */
						layer.msg(data.info,{icon:1,time:3000},function()
						{
							if(data.code == '0')
							{
								var index = parent.layer.getFrameIndex(window.name);
								parent.$('.btn-success').click();
								parent.layer.close(index);
							}
						});
					},
					dataType:"json"
				});
			}
		});
		/* 初始化百度编辑器 */
		var ue = UE.getEditor('editor');
	});
</script>
</body>
</html>